[CAMEL 21975] Jbang diagram command to visualize camel routes#21534
[CAMEL 21975] Jbang diagram command to visualize camel routes#21534vignesh-manel wants to merge 3 commits intoapache:mainfrom
Conversation
ed37eef to
9e895ac
Compare
|
Thanks for helping with jbang. Can you make this into its own plugin as this should not be in the core. You can look at one of the existing pluigins such as the new validate |
| <pgjdbc-ng-driver-version>0.8.9</pgjdbc-ng-driver-version> | ||
| <picocli-version>4.7.7</picocli-version> | ||
| <pinecone-client-version>3.1.0</pinecone-client-version> | ||
| <playwright-version>1.43.0</playwright-version> |
There was a problem hiding this comment.
This version is quite old, can you use the latest 1.58.0?
|
|
||
| @CommandLine.Command(name = "diagram", description = "Visualize Camel routes using Hawtio", sortOptions = false, | ||
| showDefaultValues = true) | ||
| public class Diagram extends CamelCommand { |
There was a problem hiding this comment.
This class is quite big, can you split it in smaller classes?
There is javascript code that is hard to read as it is, please put the js code in the resource folder in .js files.
| if (hawtioProcess != null && !hawtioProcess.process.isAlive()) { | ||
| throw new IllegalStateException("Hawtio terminated before startup." + formatHawtioOutput(hawtioProcess.output)); | ||
| } | ||
| Thread.sleep(500); |
There was a problem hiding this comment.
This is fragile, would it be possible to implement some kind of polling healthcheck instead?
| return true; | ||
| } | ||
| try { | ||
| Thread.sleep(200); |
| Locator expandAll = page.locator("#camel-tree-view button:has-text(\"Expand all\")"); | ||
| if (expandAll.count() > 0) { | ||
| expandAll.first().click(); | ||
| page.waitForTimeout(300); |
There was a problem hiding this comment.
This is fragile as well, there may be alternatives like waitForSelector, or waitForFunction, waitForResponse that can be used instead
| Locator expandAll = page.locator("#camel-tree-view button:has-text(\"Expand all\")"); | ||
| if (expandAll.count() > 0) { | ||
| expandAll.first().click(); | ||
| page.waitForTimeout(300); |
| if (search.count() > 0) { | ||
| search.fill(routeId); | ||
| page.waitForTimeout(300); | ||
| } |
|
|
||
| private void normalizeDiagramLayout(Page page) { | ||
| try { | ||
| page.evaluate("(() => {" |
Description
Added Playwright-based PNG export for camel diagram via hawtio and Jolokia
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.